//连续发送多条请求测试
#include <iostream>
#include "../Server/Server.hpp"

int main()
{
    TcpSocket client_socket;
    client_socket.ClientCreate("127.0.0.1",8080);
    std::string req = "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";    
    req+="GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    req+= "GET /hello HTTP/1.1\r\nConnection: keep-alive\r\nContent-Length: 0\r\n\r\n";
    while (true)
    {
        assert(client_socket.Send(req.c_str(),req.size()) >= 0);    
        char buffer[1024] = {0};
        assert(client_socket.Recv(buffer,sizeof(buffer)-1) >= 0);
        DEBUG_LOG("[%s]",buffer);
        sleep(3);
    }
    client_socket.Close();  
    return 0;
}